package com.torry.edss.domain.valueobject;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

@AllArgsConstructor
@Getter
public enum LimitType {

    /**
     *
     */
    UP(1, "涨停"),
    BOMB(2, "炸板"),
    DOWN(3, "跌停"),
    ;

    private Integer code;
    private String decr;


    public static LimitType parse(Integer code) {
        return Objects.isNull(code) ? null : Arrays.stream(LimitType.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}